//
//  MineTableViewCell.swift
//  E-CycleForShop
//
//  Created by enghou on 17/3/8.
//  Copyright © 2017年 xyxorigation. All rights reserved.
//

import UIKit

class MineTableViewCell: UITableViewCell {

    
    var label : UILabel = UILabel.init()
    
    var title : String = "" {
        didSet{
            label.text = title
        }
    }
    
    var line = UIView.init()
    var dot = UIView.init()
    override func awakeFromNib() {
        super.awakeFromNib()
        // Initialization code
    }
    
    override init(style: UITableViewCellStyle, reuseIdentifier: String?) {
        super.init(style: style, reuseIdentifier: reuseIdentifier)
        dot.frame = CGRect.init(origin: CGPoint.init(x: 56 * YXWidthScale, y: 45 * YXHeightScale), size: CGSize.init(width: 10 * YXWidthScale, height: 10 * YXWidthScale))
        dot.layer.cornerRadius = 5 * YXWidthScale
        dot.layer.masksToBounds = true
        dot.backgroundColor = UIColor.colorWithHexString(hex: "a9a9a9")
        self.contentView.addSubview(dot)
        
        let size = "我的钱包".StringSize(font: UIFont.systemFont(ofSize: 32 * YXWidthScale))
        label.frame = CGRect.init(origin: CGPoint.init(x: 100 * YXWidthScale, y: 50 * YXHeightScale - size.height / 2), size: size)
        label.textColor = UIColor.colorWithHexString(hex: "2c2c2c")
        label.font = UIFont.systemFont(ofSize: 32 * YXWidthScale)
        self.addSubview(label)
        
        let imageView = UIImageView.init()
        imageView.frame = CGRect.init(origin: CGPoint.init(x: YXDeviceWidth - 54 * YXWidthScale - 24 * YXWidthScale, y: 36 * YXHeightScale), size: CGSize.init(width: 24 * YXWidthScale, height: 40 * YXHeightScale))
        imageView.image = UIImage.load(name: "icon_enter")
        self.contentView.addSubview(imageView)
    
        
        
    }
    
    
    
    required init?(coder aDecoder: NSCoder) {
        fatalError("init(coder:) has not been implemented")
    }

    override func setSelected(_ selected: Bool, animated: Bool) {
        super.setSelected(selected, animated: animated)
        dot.backgroundColor = UIColor.colorWithHexString(hex: "a9a9a9")
        line.backgroundColor = UIColor.colorWithHexString(hex: "ececec")
    }
    
    override func setHighlighted(_ highlighted: Bool, animated: Bool) {
        super.setHighlighted(highlighted, animated: animated)
        dot.backgroundColor = UIColor.colorWithHexString(hex: "a9a9a9")
        line.backgroundColor = UIColor.colorWithHexString(hex: "ececec")
//        if highlighted == false {
//            line.backgroundColor = UIColor.colorWithHexString(hex: "ececec")
//        }else{
//            line.backgroundColor = UIColor.clear
//        }
    }

}
